package com.tmy.entity;

import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 评分实体类
 */
@Data
@TableName(value = "tab_comment",autoResultMap = true)
public class Comment implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(type = IdType.AUTO)
    private Integer Id;
    private Integer userId;
    private Integer hotelId;
    private Integer roomId;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    private String comment;//评论信息
    private Double score;//打分
    @TableField(typeHandler = FastjsonTypeHandler.class,exist = false)
    private JSONObject roomInfo;
    @TableField(typeHandler = FastjsonTypeHandler.class,exist = false)
    private JSONObject userInfo;
}
